<%-- 
    Document   : form
    Created on : 04/09/2009, 16:36:24
    Author     : leidson
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<%@page import= "javacademic.autor.Autor"%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Autores</title>
    </head>
    <% Autor p = (Autor)request.getAttribute("autor");%>
    <body>
        <h1>Cadastro de Autores</h1>
        <br />
        <% if (p == null){ %>
        <form method ="post" action="IncluirAutorServlet">
        <%} else {%>
        <form method="post" action="AlterarAutorServlet">
         <% } %>
         <table>
             <% if (p != null){ %>
              <tr>
                    <td>Código:</td>
                    <td><input readonly name="codigo" type ="text" value="<%= p.getCodigo() %>" /></td>
                </tr>
                <% } %>
                <tr>
                    <td>Nome:</td>
                    <td><input name="nome" type ="text" value="<%= ((p != null) ? p.getNome() : "") %>" /></td>
                </tr>
                <tr>
                    <td>Citacao:</td>
                    <td><input name="citacao" type ="text" value="<%= ((p != null) ? p.getCitacao() : "") %>" /></td>
                </tr>
         </table>
                <table>
                    <tr>
                    <td><input type="submit" value="Salvar"/></td>
                    <td><a href="ListarAutorServlet">Voltar</a></td>
                </tr>
                </table>
                </form>
    </body>
</html>
